<!--
 * @Description:
 * @Author: maryna
 * @Date: 2021-04-05 20:54:12
 * @LastEditTime: 2021-08-14 11:16:04
-->
<template>
  <div class="btnGroup-container">
    <span v-action="editAction" class="column-btn edit-btn" @click="editClick">编辑</span>
    <span v-action="delAction" class="column-btn delete-btn margin-left" @click="deleteClick">删除</span>
  </div>
</template>

<script>
import { action } from '@/directive/permission/index.js' // 权限判断指令
export default {
  name: 'BtnGroup',
  directives: {
    action
  },
  props: {
    row: {
      type: Object,
      default: () => { }
    },
    edit: {
      // 修改
      type: Boolean,
      default: true
    },
    del: {
      // 删除
      type: Boolean,
      default: true
    },
    editAction: {
      type: String,
      default: ''
    },
    delAction: {
      type: String,
      default: ''
    }
  },
  data() {
    return {}
  },
  created() { },
  methods: {
    // 修改
    editClick() {
      this.$emit('editClick', this.row)
    },
    // 删除
    deleteClick() {
      this.$emit('deleteClick', this.row)
    }
  }
}
</script>

<style scoped>
.margin-left {
  margin-left: 15px;
}
.column-btn {
  font-size: 14px;
  cursor: pointer;
}
.edit-btn {
  color: #39a0ff;
}
.delete-btn {
  color: #ff4444;
}
</style>

